package com.kamistoat.meimeimall.meimeimallorder.taskEngineExample;

import com.kamistoat.meimeimall.common.taskEngine.EngineTaskDetail;
import com.kamistoat.meimeimall.common.taskEngine.TaskEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.concurrent.ThreadPoolExecutor;

@Service
public class TaskEngineService {
    @Qualifier("orderTaskEngineThreadPoolExecutor")
    @Autowired
    ThreadPoolExecutor orderTaskEngineThreadPoolExecutor;

    @Autowired
    TaskEngine taskEngine;

    @Autowired
    OrderTaskEngineExecutor orderTaskEngineExecutor;

    public void test() {
        taskEngine.execute(new EngineTaskDetail(
                new HashMap<>(),
                orderTaskEngineExecutor,
                orderTaskEngineThreadPoolExecutor
        ));
    }

}
